﻿@page
@model Chino.IdentityServer.Pages.User.PersonalDataModel
@inject IStringLocalizer<Chino.IdentityServer.Pages.User.PersonalDataModel> L 
@{
    Layout = "_UserLayout";
    ViewData["pageName"] = Chino.IdentityServer.Const.UserPagesNavConst.PersonalData;
    //ViewContext.ClientValidationEnabled = true;
}


<div class="card shadow mb-3">
    <div class="card-header">
        <h6 class="h6">@L["card_header_personalData"]</h6>
    </div>
    <div class="card-body">
        <p>@L["Your account contains personal data that you have given us. This page allows you to download or delete that data."]</p>
        <p>
            <strong>@L["Deleting this data will permanently remove your account, and this cannot be recovered."]</strong>
        </p>
        <form id="download-data" asp-page="DownloadPersonalData" method="post" class="form-group">
            <button class="btn btn-primary" type="submit">@L["Download"]</button>
        </form>
        @if (Model.AllowDelete)
        {
            <p class="mt-2">
                <a id="delete" asp-page="DeletePersonalData" class="btn btn-danger">@L["Delete"]</a>
            </p>
        }
        else
        {
            <div class="mt-2">
                <p>
                    <button type="button" class="btn btn-danger" disabled>@L["Delete"]</button>
                </p>
                <div class="alert alert-warning" role="alert">
                    @L["You can't delete your personal data at the moment. Maybe your account has administrator rights"]
                </div>
            </div>
        }

        @*<div class="row">
            <div class="col-md-6">


            </div>
        </div>*@
    </div>
</div>